package xiao.ke.serviceprovider.controller;/**
 * @author XuXiaoK
 * @create 2020-01-19 14:25
 */

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import xiao.ke.serviceprovider.entity.Person;

import javax.servlet.http.HttpServletRequest;

/**
 *@Author XiaoKe
 *@Date 2020/1/19 14:25
 *@Description TODO
 */
@RestController
public class DemoController {


    @RequestMapping("/person/{personId}")
    public Person findPerson(@PathVariable("personId") Integer personId,
                             HttpServletRequest request) {
        Person person = new Person(personId, "xiaoke", 22);
        person.setName(request.getRequestURL().toString());
        return person;
    }
}
